package com.itheima.admin.web;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;
import java.util.logging.LogRecord;

/**
 * @author :WuJunJie
 * packageName :com.itheima.admin.web
 * fileName :DemoFilter
 * creationTime :2022-11-06 10:20
 */
@WebFilter("/*")
@Slf4j
//通知SpringBoot这里有一个需要管理起来的类
//@Component
public class DemoFilter implements Filter {


    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        log.info("被拦截了");
        filterChain.doFilter(servletRequest, servletResponse);
        log.info("回来了");
    }
}
